package com.demo.controller;

import com.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class BeanScopesControllerC {

    // 属性注入:直接注入就行，User对象名是之前@Bean所命名
    @Autowired
    private User userKe;


    public User getUser() {
        User user = userKe;
        user.setName("芜湖");
        return user;
    }
}
